package com.bulletelc.apollopre.manager.imageload.glideloader;

import android.content.Context;

import com.bumptech.glide.GlideBuilder;
import com.bumptech.glide.annotation.GlideModule;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.load.engine.cache.LruResourceCache;
import com.bumptech.glide.module.AppGlideModule;
import com.bumptech.glide.request.RequestOptions;

/**
 * author: lhl
 * date  : 2017/11/23
 * desc  : Glide的基本配置类
 */
@GlideModule
public final class MyAppGlideModule extends AppGlideModule{
    @Override
    public void applyOptions(Context context, GlideBuilder builder) {
        builder.setDefaultRequestOptions(new RequestOptions().format(DecodeFormat.PREFER_RGB_565));//设置默认使用565图片
        builder.setMemoryCache(new LruResourceCache(1024 * 1024 * 20));//设置内存缓存大小
    }
}
